#pragma once
#include "sgobject.h"
#include "sgptr.h"
#include "graphics/GrVector.h"

class CSgTranslate :
	public CSgObject
{
public:
	CSgTranslate() {m_x=m_y=m_z = 0.; m_child = NULL;}
	CSgTranslate(CGrVector tv)
	{
		//CSgTranslate(tv.X(), tv.Y(), tv.Z());
		// ^^ that doesn't do what we think it does.
		// it just creates a nameless object and deletes it.
		// it does not overload our constructor. OOPS!
		m_x=tv.X(); m_y=tv.Y(); m_z=tv.Z(); m_child = NULL;
	}
	CSgTranslate(double x, double y, double z) {m_x=x; m_y=y; m_z=z; m_child = NULL;}
//	CSgTranslate(double x, double y, double z, CSgObject *p_child) {m_x=x; m_y=y; m_z=z; m_child=p_child;}
	~CSgTranslate();
	virtual void Render();
	void SetChild(CSgObject *p_child) {m_child = p_child;}

	void SetTranslate(double x, double y, double z){m_x = x; m_y = y; m_z = z;}

private:
	CSgPtr<CSgObject> m_child;
	double m_x, m_y, m_z;
};
